package ma.ac.onousc.gestionfi.budget.model;

import java.io.Serializable;
import javax.persistence.*;

import java.util.Date;

/**
 * The persistent class for the soumettre database table.
 * 
 */
@Entity
@NamedQueries({ @NamedQuery(name = "Soumettre.isBudgetSoumis", query = "select o from Soumettre o where ((:ETABLISSEMENT <> NULL and o.etablissement.idEtablissement = :ETABLISSEMENT) or (o.etablissement = NULL and :ETABLISSEMENT = NULL)) and o.programmeEmploi.idProgrammeEmploi = :PROGRAMME_EMPLOI") })
public class Soumettre implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "ID_SOUMETTRE")
	private int idSoumettre;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "DATE_SOUMISSION")
	private Date dateSoumission;

	// bi-directional many-to-one association to Etablissement
	@ManyToOne
	@JoinColumn(name = "ID_ETABLISSEMENT")
	private Etablissement etablissement;

	// bi-directional many-to-one association to Personnel
	@ManyToOne
	@JoinColumn(name = "ID_PERSONNEL")
	private Personnel personnel;

	// bi-directional many-to-one association to ProgrammeEmploi
	@ManyToOne
	@JoinColumn(name = "ID_PROGRAMME_EMPLOI")
	private ProgrammeEmploi programmeEmploi;

	public Soumettre() {
	}

	/**
	 * 
	 * @param etablissement
	 * @param personnel
	 * @param programmeEmploi
	 * @param dateSoumission
	 */
	public Soumettre(Etablissement etablissement, Personnel personnel,
			ProgrammeEmploi programmeEmploi, Date dateSoumission) {
		this.etablissement = etablissement;
		this.personnel = personnel;
		this.programmeEmploi = programmeEmploi;
		this.dateSoumission = dateSoumission;
	}

	public int getIdSoumettre() {
		return this.idSoumettre;
	}

	public void setIdSoumettre(int intSoumettre) {
		this.idSoumettre = intSoumettre;
	}

	public Date getDateSoumission() {
		return this.dateSoumission;
	}

	public void setDateSoumission(Date dateSoumission) {
		this.dateSoumission = dateSoumission;
	}

	public Etablissement getEtablissement() {
		return this.etablissement;
	}

	public void setEtablissement(Etablissement etablissement) {
		this.etablissement = etablissement;
	}

	public Personnel getPersonnel() {
		return this.personnel;
	}

	public void setPersonnel(Personnel personnel) {
		this.personnel = personnel;
	}

	public ProgrammeEmploi getProgrammeEmploi() {
		return this.programmeEmploi;
	}

	public void setProgrammeEmploi(ProgrammeEmploi programmeEmploi) {
		this.programmeEmploi = programmeEmploi;
	}

}